package com.dxy.md.service.impl;

import com.dxy.md.core.DataSource;
import com.dxy.md.model.po.StudentPO;
import com.dxy.md.mapper.StudentMapper;
import com.dxy.md.service.StudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author builder
 * @since 2022-03-26
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, StudentPO> implements StudentService {

    @Override
    @DataSource(name = "ds2")
    public void saveStudent(String name, int age) {
        StudentPO studentPO = new StudentPO();
        studentPO.setName(name);
        studentPO.setAge(age);
        baseMapper.insert(studentPO);
    }
}
